package API.DAY11.reflect;

import API.DAY10.reflect.Person;

import java.lang.reflect.Method;

public class ReflectDemo5 {
    public static void main(String[] args) throws Exception{
        Person p = new Person();
        p.say("大家好");

        Class cls = Class.forName("API.DAY10.reflect.Person");
        Object obj = cls.newInstance();

        Method method = cls.getMethod("say",String.class);
        method.invoke(obj,"大家好");

    }
}
